import request from '@/request'
import {C2B} from '@/utils/wordtransfer.js'

// 查询板块列表
export const findPagesAll = (data) => {
    return request.post("/course/category/treeall",data)
}

// 查询板块列表
export const findPages = (data) => {
    return request.post("/course/category/tree",data)
}

// 查询根板块
export const findPagesRoot = () => {
    return request.post("/course/category/root",{})
}

// 保存和更新
export const saveUpdate = (data) => {
    return request.post("/course/category/saveupdate",data)
}

// id查询明细
export const getById = (id) => {
    return request.post(`/course/category/get/${id}`,{})
}

// id删除
export const delById = (id) => {
    return request.post(`/course/category/del/${id}`,{})
}

// 修改状态
export const updateStatus = (id,field,value) => {
    field = C2B(field)
    return request.post(`/course/category/status/${id}/${field}/${value}`,{})
}

// 复制
export const copyData = (id) => {
    return request.post(`/course/category/copy/${id}`, {})
}
